
<template>
  <div>
    <el-button type="primary" @click="handleAdd" style="float: right">新增</el-button>
    <el-table :data="tableData">
      <el-table-column label="名称" prop="name" />
    </el-table>
  </div>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
const tableData = ref([
  { name: '示例数据1' },
  { name: '示例数据2' }
])

const handleAdd = () => {
  tableData.value.push({ name: '新数据' })
}
</script>